<?php
include "../default.php";
include "../config.php";
$server = BASEURL;

$dom = new DomDocument('1.0','utf-8');

$rss = $dom->appendChild($dom->createElement("rss"));

$rss->setAttribute('version','2.0');

// ** main container ** //
$channel = $rss->appendChild($dom->createElement("channel"));
$title = $channel->appendChild($dom->createElement("title"));
$title->appendChild($dom->createTextNode('99 Bali Hotels | All Bali Hotels & Bali Villas'));
$mainDescription = $channel->appendChild($dom->createElement("description"));
$mainDescription->appendChild($dom->createTextNode('Bali Season Tour is Private Tour Service in Bali, Bali Season Tour offers professional services to guide you during your vacation in Bali'));
$mainLink = $channel->appendChild($dom->createElement("link"));
$mainLink->appendChild($dom->createTextNode($server));

// ** item feed ** //
// about us
$item = $channel->appendChild($dom->createElement("item"));
$title = $item->appendChild($dom->createElement("title"));
$title->appendChild($dom->createTextNode('About Us | 99 Bali Hotels'));
$description = $item->appendChild($dom->createElement("description"));
$description->appendChild($dom->createTextNode('Bali Season Tour is Private Tour Service in Bali, Bali Season Tour offers professional services to guide you during your vacation in Bali'));
$link = $item->appendChild($dom->createElement("link"));
$link->appendChild($dom->createTextNode($server.'about_us.html'));

// contact
$item = $channel->appendChild($dom->createElement("item"));
$title = $item->appendChild($dom->createElement("title"));
$title->appendChild($dom->createTextNode('Contact | 99 bali Hotels'));
$description = $item->appendChild($dom->createElement("description"));
$description->appendChild($dom->createTextNode('Bali Season Tour is Private Tour Service in Bali, Bali Season Tour offers professional services to guide you during your vacation in Bali'));
$link = $item->appendChild($dom->createElement("link"));
$link->appendChild($dom->createTextNode($server.'contact.html'));
	
// ** package tour **//
$query = mysql_query("SELECT * FROM hotels");

while ($data = mysql_fetch_array($query)) {
	$item = $channel->appendChild($dom->createElement("item"));
	$title = $item->appendChild($dom->createElement("title"));
	$title->appendChild($dom->createTextNode($data['hotel_name']." | All Bali Hotels & Bali Villas"));
	$description = $item->appendChild($dom->createElement("description"));
	$description->appendChild($dom->createTextNode($data['overview']));
	$link = $item->appendChild($dom->createElement("link"));
	$link->appendChild($dom->createTextNode($server.$data['hotel_slug'].".html"));
}

$dom->save("../feed.xml");

?>